package com.test.mapper;

import com.test.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserMapper {
    @Select("select * from user where id = #{id}")
    User getById(Integer id);

    @Insert("insert into user (username, nickname, birthday) values (#{user.username}, #{user.nickname}, #{user.birthday})")
    void insertUser(@Param("user") User user);
}
